package com.example.presentshopping.ui.fragment.frgmentdlog

import android.os.Bundle
import android.view.View
import android.widget.Button
import com.example.presentshopping.R
import com.example.presentshopping.config.base.BaseFragmentDialog
import com.example.presentshopping.utils.tool.unit.DimenUtil

class SigninDialog : BaseFragmentDialog() {
    //调整窗口样式
    override fun onStart() {
        super.onStart()
        // 弹框添加。
        val dialog = dialog
        if (dialog != null && activity != null) {
            //设置窗口的背景
            dialog.window!!.setBackgroundDrawableResource(android.R.color.transparent)
            val lp = dialog.window!!.attributes
            lp.dimAmount = 0.8f //设置窗口后面的暗度
            // lp.alpha = 0.8f;//设置dialog窗口的透明度
            //设置dialog窗口的宽
            lp.width = ((DimenUtil.getScreenWidth() * 0.85f).toInt())
            lp.height = ((DimenUtil.getScreenHeight()*0.5).toInt())//设置dialog窗口的高
            dialog.window!!.attributes = lp
        }
    }


    override fun initView(view: View?, savedInstanceState: Bundle?) {
        view?.findViewById<Button>(R.id.singshuan)?.setOnClickListener {
              dismiss()
        }

    }

    override val layoutId: Int
        get() = R.layout.signin_dialog
}